package cn.zymall.app.service.impl;

import cn.zymall.app.mapper.CityViewMapper;
import cn.zymall.app.service.CityViewService;
import cn.zymall.common.model.CityView;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author xuxainda
 * @Description: 三级联动业务层接口实现类
 * @date 2020/8/27 21:04
 * @Copyright
 * @return
 **/
@Service
public class CityViewServiceImpl extends ServiceImpl<CityViewMapper, CityView> implements CityViewService {
    @Autowired
    CityViewMapper cityViewMapper;

    @Override
    public CityView getByDistrict(CityView cityView) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("districts_code", cityView.getDistrictsCode());
        return cityViewMapper.selectOne(queryWrapper);
    }
}
